package tec;

class Prudent extends Comportement{

	void choixChangerPlace(Bus b,Passager passager,int numeroArret){
		PassagerAbstrait p = (PassagerAbstrait) passager;
		if(p.getDestination()-numeroArret>5){
		    if(passager.estAssis())
			throw new IllegalStateException("Passager deja Assis");
		    b.demanderPlaceAssise(p);
		
		}
		else{
			if(p.getDestination()-numeroArret<3){
			    if(passager.estDebout())
				throw new IllegalStateException("Passager deja debout");
			    b.demanderChangerEnDebout(p);// DemanderCchangerenDebout?
			}
			else{
			    if(passager.estAssis())
				throw new IllegalStateException("Passager deja Assis");
			    b.demanderChangerEnAssis(p);//demanderChangerEnAssis()?	
			}
		}
	}
}
